<template>
	<view class="fangzhen">
		<!-- 广告图 -->
		<view class="banner">
			<image style="height: 240upx;" src="../../../static/banner/fz.png" mode=""></image>
		</view>
		<!-- 政策方针 -->
		<view class="zc">
			<text>{{zcname[0].name}}</text>
			<view class="zc_t uni-flex" v-for="(item,index) in fangzhen" @click="tz(item.policyId)" :key="index">
				<view class="zc_z">
					<image src="/static/banner/zc.png" mode="widthFix"></image>
				</view>
				<view class="zc_r">
					<text class="zc_r_t slh">{{item.name}}</text>
					<view class="zc_r_b" style="color: #555;" v-html="item.content"></view>
				</view>
			</view>
		</view>
		<!-- 横线 -->
		<hengxian></hengxian>
		<!-- 政策方针 -->
		<view class="zc">
			<text>{{zcname[1].name}}</text>
			<view class="zc_t uni-flex" v-for="(item,index) in zhengce" :key="index" @click="tz(item.policyId)">
				<view class="zc_z">
					<image src="/static/banner/zc.png" mode="widthFix"></image>
				</view>
				<view class="zc_r">
					<text class="zc_r_t slh">{{item.name}}</text>
					<rich-text class="zc_r_b" :nodes="item.content"></rich-text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	var con = '/static/banner/fz.png'
	export default{
		data() {
			return {
				con:con,
				show:false,
				title: 'Hello',
				zhengce:[],
				fangzhen:[],
				zcname:[]
			}
			
		},
		onLoad() {
		
		},
		created() {
			let that = this
			let params = {
				"pageNo":1,
				"pageSize":99999,
				"typeId":1
			}
			let paramss = {
				"pageNo":1,
				"pageSize":99999,
				"typeId":2
			}
			// let headers={
			// 	 'content-type': 'application/x-www-form-urlencoded',
			// 	 'token': uni.getStorageSync('token')
			// }
			that.pyReq(that.$http.getPolicy,params,function(res){
					  that.zhengce = res.result
			});
			// uni.request({
			// 	  url: that.$http.getPolicy,
			// 	  method: 'POST',
			// 	  data:params,
			// 	  header:headers,
			// 	  success: (res)=>{
			// 		  console.log(res)
			// 		  that.zhengce = res.data.result
			// 	  },
			// 	  fail: (err)=>{
			// 		  console.log(err)
			// 	  }
			// })  
			that.pyReq(that.$http.getPolicy,paramss,function(res){
					  that.fangzhen = res.result
			});
			// uni.request({
			// 	  url: that.$http.getPolicy,
			// 	  method: 'POST',
			// 	  data:paramss,
			// 	  header:headers,
			// 	  success: (res)=>{
			// 		  console.log(res)
			// 		  that.fangzhen = res.data.result
			// 	  },
			// 	  fail: (err)=>{
			// 		  console.log(err)
			// 	  }
			// })  
			//方针政策的分类信息
			that.pyReq(that.$http.getPolicyType,{},function(res){
					  that.zcname = res.result
			});
			// uni.request({
			// 	  url: that.$http.getPolicyType,
			// 	  method: 'POST',
			// 	  header:headers,
			// 	  success: (res)=>{
			// 		  console.log(res)
			// 		  that.zcname = res.data.result
			// 	  },
			// 	  fail: (err)=>{
			// 		  console.log(err)
			// 	  }
			// })  
		},
		methods: {
			//导航
			tz(id){
				uni.navigateTo({
					url:'./zhengce?id='+id
				})
			}
		}
	}
</script>

<style>
	.banner{
		margin: 28upx;
	}
	.zc>text{
		font-size: 30upx;
		margin-left: 20upx;
	}
	.zc>.zc_t:last-child{
		margin-bottom: 20upx;
	}
	.zc_t{
		margin-top: 23upx;
	}
	.zc_z{
		width: 120upx;
		height: 120upx;
		border-radius: 10upx;
		overflow: hidden;
		box-shadow:0px 1px 8px #D9D9D9;
		box-shadow:0px 1px 8px #D9D9D9;
		margin-left: 20upx;
		flex-shrink:0;
	}
	.zc_z>image{
		/* height: 120upx; */
	}
	.zc_r{
		height: 120upx;
		margin-left: 23upx;
		margin-right: 20upx;
		overflow: hidden;
	}
	.zc_r>text{
		/* display: block; */
	}
	.zc_r_t{
		font-size: 28upx;
		font-weight: 700;
		margin-top: 3upx;
	}
	.zc_r_b{
		font-size:26upx;
		font-weight: 500;
		line-height: 32upx;
		/* margin-top: 14upx; */
		max-height: 60upx;
		overflow: hidden;
		-webkit-line-clamp: 2;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		clear: both;
	}
	.fangzhen{
		padding-bottom: 30upx;
	}
</style>
